from flask.blueprints import Blueprint
from toutiaoapi.restful import BaseApi
from . import views

# 创建蓝图
user_blueprint = Blueprint('user', __name__, url_prefix='/app/v1_0')

# Api接管蓝图
user_api = BaseApi(user_blueprint)

# 类视图，在views中

# 添加路由
# 登陆
user_api.add_resource(views.LoginResource, '/authorizations')
# 获取担心验证码
user_api.add_resource(views.SmsCodeResource, '/sms/codes/<mobile>/')

# 压力测试
# 有缓存, 获取用户数据
user_api.add_resource(views.UserInfoResource, '/user')
# 无缓存
user_api.add_resource(views.CacheUserInfoResource, '/user/cache')
